entry-completion: set size request on the toplevel window
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 27 Mar 2012 18:23:48 +0000 (14:23 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 4 May 2012 19:43:29 +0000 (15:43 -0400)
Instead of setting it on the child scrolled window. This is needed
because the whole window's allocation must be equal to the one of the
entry (in case the popup-set-width property is TRUE); if we set the size
request on a children of the window, there might be other children with
borders/paddings in between the toplevel and the child we set the size
request too, which will break alignment.

https://bugzilla.gnome.org/show_bug.cgi?id=672947

gtk/gtkentrycompletion.c

index dc8d7e538f56e4c7396cae6de398230090913992..cd72d28bbe3863985fc6e5c1625b5dde8484f2b4 100644 (file)
@@ -1535,14 +1535,11 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
 
   gtk_tree_view_columns_autosize (GTK_TREE_VIEW (completion->priv->tree_view));
   gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (completion->priv->scrolled_window), width);
-  gtk_widget_set_size_request (completion->priv->scrolled_window, width, -1);
+  gtk_widget_set_size_request (completion->priv->popup_window, width, -1);
   gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (completion->priv->scrolled_window), items * height);
 
   if (actions)
-    {
-      gtk_widget_show (completion->priv->action_view);
-      gtk_widget_set_size_request (completion->priv->action_view, width, -1);
-    }
+    gtk_widget_show (completion->priv->action_view);
   else
     gtk_widget_hide (completion->priv->action_view);